using System;
using System.Collections.Generic;
using System.Text;
using DAP;
using Dominio;

namespace Presenters
{
    public class AdmSecPresenter
    {
        private FamilyRepository familyRep;
        private PatRepository patRep;
        private IList<Patente> patentes;
        private IList<Familia> familias;

        public AdmSecPresenter()
        {
            familyRep = new FamilyRepository();
            patRep = new PatRepository();
        }

        public IList<Patente> getPatList()
        {
            return patRep.getPatList();
        }
        public IList<Familia> getFamilyList()
        {
            this.familias = familyRep.getFamilyList();
            return familias;
        }

        public IList<Patente> getFiltredPat(int familyId)
        {
            foreach (Familia f in familias)
            {
                if (f.Id.Equals(familyId))
                {
                    this.patentes = f.Patentes;
                }
            }
            return patentes;
        }
    }
}
